package com.huang.core;

import java.util.HashMap;
import java.util.Map;

import com.huang.core.util.PropertiesUtil;

public class TableSelectUtil {
	static Map<String,Class> tableMap = new HashMap<String,Class>();
	
	public static Object getTableService(String key) throws ClassNotFoundException, InstantiationException, IllegalAccessException{
		if(tableMap.get(key)==null){
			String nowDB = PropertiesUtil.getSingle().getValue("config.db.type");
			Class table = Class.forName("com.huang.core.DB.dbselect."+nowDB+"."+nowDB+key);
			tableMap.put(key,table);
		}
		return tableMap.get(key).newInstance();
	}
}
